/*@ File Name : vector3.h
  @ Date : 18/11/2011
  @ Author : Guillaume Collombet, Ulysse Mensa, Sylvain Chambe

Fireworks simulation projet
Copyright (C) 2011 Guillaume Collombet, Ulysse Mensa, Sylvain Chambe

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.

You can contact us by sending mail at fireworks-simulation-project@googlecode.com*/

#if !defined(_VECTOR3_H)
#define _VECTOR3_H

/**
* Vecteur
*/
struct s_Vector3f {
	float x;/**<Composante X du vecteur*/
	float y;/**<Composante Y du vecteur*/
	float z;/**<Composante Z du vecteur*/
} typedef Vector3f;

/*! degree -> radian*/
float rad(const float a);

/*! v=(x,y,z)*/
void Vector3f_Init(Vector3f* v, const float x, const float y, const float z);

/*! spherical coord -> (x,y,z)*/
void Vector3f_InitFromAngle(Vector3f* v, const float a, const float b);

/*! R=A+B*/
void Vector3f_Add(Vector3f* R, const Vector3f* A, const Vector3f* B);

/*! R=A-B*/
void Vector3f_Sub(Vector3f* R, const Vector3f* A, const Vector3f* B);

/*! R = a*B*/
void Vector3f_Mul(Vector3f* R, const float a, const Vector3f* B);

/*! Scalar product*/
float Vector3f_Dot(const Vector3f* A, const Vector3f* B);

/*! Cross product (produit vectoriel)*/
void Vector3f_Cross(Vector3f* R, const Vector3f* A, const Vector3f* B);

/*! normalize the vector*/
void Vector3f_Normalize(Vector3f* v);

/*! return the length of the vector*/
float Vector3f_Length(const Vector3f* v);

#endif  /*_VECTOR3_H*/
